﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class ConfigValueFactory {
        public static void Delete ( ConfigValueBase configvalue ) {
            DataClient.Current.ConfigValueDelete ( configvalue.IntData );
        }

        public static List<ConfigValue> GetByConfig ( int config ) {
		    List<ConfigValue> outlist = new List<ConfigValue> ();
            Watchdog.Facade.ConfigValue[] list = Dal.DataClient.Current.ConfigValueGetByConfig ( config );
            foreach (Watchdog.Facade.ConfigValue item in list)
                outlist.Add ( new ConfigValue(item));
            return outlist;
            // return DataClient.Current.ConfigValueGetByConfig ( config );
        }
        public static ConfigValue GetById ( int id ) {
            return new ConfigValue (DataClient.Current.ConfigValueGetById (id));
        }
				
        public static List<ConfigValue> GetByTest ( int test ) {
		    List<ConfigValue> outlist = new List<ConfigValue> ();
            Watchdog.Facade.ConfigValue[] list = Dal.DataClient.Current.ConfigValueGetByTest ( test );
            foreach (Watchdog.Facade.ConfigValue item in list)
                outlist.Add ( new ConfigValue(item));
            return outlist;
            // return DataClient.Current.ConfigValueGetByTest ( test );
        }
        public static void Insert ( ConfigValueBase configvalue ) {
            configvalue.IntData = DataClient.Current.ConfigValueInsert ( configvalue.IntData );
        }
		
        public static void Update ( ConfigValueBase configvalue ) {
            DataClient.Current.ConfigValueUpdate ( configvalue.IntData );
        }
		
	}
}
